<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRegionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('region', function (Blueprint $table) {
            $table->increments('id');
            $table->char("code",6)->defautl('')->comment("行政区划代码");
            $table->string("name",50)->default('')->comment("地区名称");
            $table->char("parent_code",6)->default('')->comment('父级行政区划代码');
            $table->tinyInteger("level")->default(0)->comment('级别，省：1 市：2 区：3');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('region');
    }
}
